﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BLL;
using Model;

public partial class PCBA_ViewPCBA_PCBAssemble_PCBAssembleItemViewbyBatchID : System.Web.UI.Page
{
    PCBAssembleItem pai;
    private string batchID
    {
        get
        {
            return ViewState["BatchID"].ToString();
        }
        set
        {
            ViewState["BatchID"] = value;
        }
    }

    public PCBA_ViewPCBA_PCBAssemble_PCBAssembleItemViewbyBatchID()
    {
        pai = new PCBAssembleItem();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["BatchID"] != null)
            {
                batchID = Request.QueryString["BatchID"];
                this.TextBox1.Text = batchID;
                BindData();
            }
        }
    }

    protected void BindData()
    {
        this.GridView1.DataSource = pai.GetPCBAssembleItembyBatchID(batchID);
        this.GridView1.DataBind();
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        batchID = this.TextBox1.Text.Trim();
        BindData();
    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindData();
    }
}
